package com.smarttiger.zero.admin.dao;

import com.smarttiger.zero.admin.dto.MonitorDto;
import com.smarttiger.zero.admin.entity.LogsModel;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Component
public interface LogsDao extends BaseDao<LogsModel> {

    @Query("select new com.smarttiger.zero.admin.dto.MonitorDto( l.code ,l.name, count(l)) " +
            "from  LogsModel  l  where l.startDate between ?1 and ?2 " +
            "group by l.code,l.name order by l.code ")
    public List<MonitorDto> queryLogsGroup(Date one, Date two);
}
